package com.leetcode.partition5;

/**
 * @author `RKC`
 * @date 2021/11/25 11:32
 */
public class LC458可怜的小猪 {

    public static int poorPigs(int buckets, int minutesToDie, int minutesToTest) {
        //解法：https://leetcode-cn.com/problems/poor-pigs/solution/hua-jie-suan-fa-458-ke-lian-de-xiao-zhu-by-guanpen/
        int base = minutesToTest / minutesToDie + 1;
        return (int) Math.ceil(Math.log(buckets) / Math.log(base));
    }
}
